import { defHttp } from '/@/utils/http/axios';
import { updateUserModel, userParams } from '/@/extendModel/agreementModel';
enum Api {
  addEditeStorage = '/storage/storage',
  getStorageList = '/storage/storages',
  Updateuser = '/user/update_user',
  Getuser = '/user/get_user',
}

/**
 * @description: Get user menu based on id
 */

//获取存储配置
export const getStorageList = (params) => {
  return defHttp.get({ url: Api.getStorageList, params });
};
//新增存储配置
export const addStorage = (data) => {
  return defHttp.post({ url: Api.addEditeStorage, data });
};

//更新存储配置
export const updateStorage = (data) => defHttp.patch({ url: Api.addEditeStorage, data });

//更新用户信息
export const updateUser = (data: updateUserModel) =>
  defHttp.patch<updateUserModel[]>({ url: Api.Updateuser, data });

//获取存储配置
export const getUser = (params?: userParams) => {
  return defHttp.get({ url: Api.Getuser, params });
};
